// 封装文章相关的接口
import axios from "@/utils/request"

// 获取文章列表
export function article(params){
    return axios({
        url: "/post",
        method: "get",
        params
    })
}

// 文章详情
export function articleDetail(id){
    return axios({
        url: "/post/"+id,
        method: "get"
    })
}

// 文章的评论列表数据
export function post_comment(id){
    return axios({
        url:"/post_comment/"+id,
        method: "get"
    })
}

// 发表评论
export function publish(id,data ){
    return axios({
        url: "/post_comment/"+id,
        method: "post",
        data
    })
}

// 搜索文章
export function search(params){
    return axios({
        url: "/post_search",
        params
    })
}